/*
 * Tank.hpp
 *
 *  Created on: 04.10.2013
 *      Author: dima
 */

#ifndef MODEL_TANK_HPP_
#define MODEL_TANK_HPP_


#include "GameObjectModel.hpp"
#include "MissileModel.hpp"
#include "Types.hpp"

#include <list>
#include <map>


namespace Tanks
{

namespace Model
{

  class TankModel : public GameObjectModel
  {
  public:
    TankModel();
    ~TankModel();

    void SetVelocity(int argXVelocity, int argYVelocity);

    Direction GetDirection() const {return m_direction;}

    int GetTeam(){ return m_team; }

    void Shoot();

    bool IsAlive() const { return m_alive; }
    bool IsMoving() const { return m_moving; }
    bool IsShooting() const { return m_shooting; }
    bool IsExploding() const { return m_exploding; }

    void Die();

    void Tick();

    virtual void Collision(GameObjectModel * argGameObject,
                 CollisionModel::CollisionSide argCollisionSide,
                 bool argActive);
  protected:

    bool m_alive,
         m_moving,
         m_shooting,
         m_exploding;

    int m_damage;
    float m_fireRate;
    int m_missileSpeed;
    int m_speed;
    int m_health;

    int m_oldX, m_oldY;

    long m_lastShot;

    int m_XVelocity, m_YVelocity;
    Direction m_direction;

    int m_explosionStartTime, m_explosionDuration;

  };

}

}


#endif /* MODEL_TANK_HPP_ */
